package bg.btanev.eightyfour.shared.analytics;


/**
 *
 * @author B.Tanev
 *
 */
public abstract class TimePediodActovityStat extends CountingStat {
	/**
	 *
	 */
	private static final long serialVersionUID = 7313621654712048164L;

	private int periodId;

	protected TimePediodActovityStat() {
		super();
	}

	protected TimePediodActovityStat(double pediodId, long total) {
		super(total);

		int pediodIdNum = (int) pediodId;
		this.periodId = pediodIdNum;
	}

	protected int getPeriodId() {
		return this.periodId;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + periodId;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		TimePediodActovityStat other = (TimePediodActovityStat) obj;
		if (periodId != other.periodId)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "TimePediodActovityStat [periodId=" + periodId + ", toString()=" + super.toString() + "]";
	}
}
